Release 10.1A: OpenEdge Development:
Progress 4GL Reference
CURRENT-VALUE statement
Resets the current integer value of a sequence defined in the Data Dictionary.
Syntax
sequenceAn identifier that specifies the name of a sequence defined in the Data Dictionary.
logical-dbnameAn identifier that specifies the logical name of the database in which the sequence is defined. The database must be connected. You can omit this parameter if the sequence name is unambiguous. If more than one connected database has a sequence with given name, then you must supply
logical-dbname.expressionAn integer expression assigned as the current value of the specified sequence. If
Exampleexpressionis outside the boundary set by the initial value (at one end) and the lower limit or upper limit (at the other end) for the sequence, Progress returns an error, and the sequence value remains unchanged.The following example resets the current value of the next-cust-num sequence to the cust-num value of the last customer record if that is a valid value for the sequence:
Notes
- The user must have CAN-WRITE privileges on the _Sequence table to use the CURRENT-VALUE statement.
- The value of a sequence set by the CURRENT-VALUE statement persists in the database until the next CURRENT-VALUE statement or NEXT-VALUE function is invoked for the sequence, or until the sequence is deleted from the database.
- You cannot set a sequence to the Unknown value (
?).- You can use any combination of the NEXT-VALUE function, CURRENT-VALUE function, CURRENT-VALUE statement, and their dynamic versions. Use the dynamic version when you don’t know what the database name or sequence name is at runtime.
See also
CURRENT-VALUE function, DYNAMIC-CURRENT-VALUE function, DYNAMIC-CURRENT-VALUE statement, DYNAMIC-NEXT-VALUE function, NEXT-VALUE function
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |